import type { RouteRecordRaw } from 'vue-router'
import Login from '@/views/login/index.vue'
import NoFound from '@/views/notFound/index.vue'
import pageHome from '@/layouts/index.vue'
const dynamicRouteFiles = import.meta.glob('./modules/**/*.ts', {
  eager: true
})
const dynamicRoutes: RouteRecordRaw[] = dynamicRouteFiles
const routes: RouteRecordRaw[] = [
  {
    meta: {
      title: 'page'
    },
    name: 'page',
    path: '/',
    redirect: '/login'
  },
  {
    name: 'Login',
    path: '/login',
    component: Login,
    meta: {
      title: '登录'
    }
  },
  {
    component: NoFound,
    meta: {
      hideInBreadcrumb: true,
      hideInMenu: true,
      hideInTab: true,
      title: '404'
    },
    name: 'FallbackNotFound',
    path: '/:path(.*)*'
  },
  {
    name: 'page',
    path: '/page',
    component: pageHome,
    children: []
  }
]
export { dynamicRoutes, routes }
